<?php

namespace mpend\modules\home\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\home\models\RecommendSearch;

/**
 * Home page content recommendation list.
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class RecommendController extends Controller {

    /**
     * @var string ActiveRecord search model.
     */
    public $modelClass = RecommendSearch::class;

    /**
     * Mixed data recommend list.
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new RecommendSearch();
        $model->load(Yii::$app->request->getQueryParams(), '');
        return $model->search();
    }

    /**
     * Mixed data recommend list.
     * @inheritdoc
     */
    public function actionNewest() {
        $model = new RecommendSearch();
        $model->recent = true;
        $model->load(Yii::$app->request->getQueryParams(), '');
        return $model->search();
    }

}
